from java.lang import String
from java.io import File
from java.util import Locale

from jscinttools.scint import Spectrum
from jscinttools.scint import SpectrumPlotter

from jscinttools.datafit import FitSettings

Locale.setDefault(Locale.ENGLISH)
#System.getProperties().setProperty("hep.aida.BatchAnalysisFactory","hep.aida.ref.BatchAnalysisFactory")
#af = IAnalysisFactory.create();

showFigures = True
writeFigures = not showFigures


""" Define the Path and files names"""
#aidaPath = "/home/marc-antoine/Documents/jCode/Dropbox/CryoDAQ/Reduced_Data/2011_03_31/"
#aidaFile = "Na22_7K_001_PhotonReanalysis_NoTuples"
#outPath = aidaPath
#startPar = [1, 95, 20, 0.4, 50, 10]
#title = "Spectrum of ^{22}Na in ZnWO_{4} at 7 K"

#aidaPath = "/home/marc-antoine/Documents/jCode/Dropbox/CryoDAQ/Reduced_Data/2011_03_31/"
#aidaFile = "Na22_20K_001_PhotonReanalysis_NoTuples"
#outPath = aidaPath
#startPar = [1, 95, 20, 0.4, 50, 10]
#title = "Spectrum of ^{22}Na in ZnWO_{4} at 20 K"

#aidaPath = "/home/marc-antoine/Documents/jCode/Dropbox/CryoDAQ/Reduced_Data/2011_03_30/"
#aidaFile = "Na22_10K_001_PhotonReanalysis_NoTuples"
#outPath = aidaPath
#startPar = [1, 95, 20, 0.4, 50, 10]
#title = "Spectrum of ^{22}Na in ZnWO_{4} at 10 K"

#aidaPath = "/home/marc-antoine/Documents/jCode/Dropbox/CryoDAQ/Reduced_Data/2011_03_16/"
#aidaFile = "Na22_3200mK_001_PhotonReanalysis_NoTuples"
#outPath = aidaPath
#startPar = [1, 75, 20, 0.4, 30, 10]
#title = "Spectrum of ^{22}Na in ZnWO_{4} at 3.2 K"

#aidaPath = "/home/marc-antoine/Documents/jCode/Dropbox/CryoDAQ/Reduced_Data/2011_03_28/"
aidaPath = "/home/marc-antoine/Dropbox/CryoDAQ/Reduced_Data/2011_03_28/"
aidaFile = "Na22_294K_002_PhotonReanalysis_NoTuples"
outPath = aidaPath
startPar = [1, 85, 20, 0.6, 30, 20]
title = "Spectrum of ^{22}Na in ZnWO_{4} at 294 K"

preliminary = True

spec = Spectrum(aidaPath + File.separator + aidaFile, FitSettings(startPar))
plotter = SpectrumPlotter(spec, title, outPath, writeFigures)

print("That's all folks !")

